Swank Wiki
Recently Visited

Swank v0.04.04

Site Wrapping

"site" is the name of the default wrapping page. 

It works similarly to the autohandler in HTML::Mason.  (Examples from other techs?) 

It is not part of the page inheritance chain for actions/methods.

Wrapping can be overridden by the swank_wrap field.

The contents of the html_head field of each wrapping page and the main page are automatically added to the html head section.

Local site page

Each directory may have a site page, which will automatically wrap around any pages in the subdirectory.  This can be used in many useful ways.

  • common layout around a set of subpages (class blogs on keystone)
  • RESTful url handling (e.g. calendar views)
  • adding things to the html head section
  • and much, much more, etc

Global site page

The site page in the root directory is a bit special, because of its placement. Everything in the site gets wrapped by this file.

It is (currently) used to provide the layout of the action buttons on the page, with help from the /actions page.  This might be moved to the layout page.

It displays errors which have been "tossed" (not thrown) in edit mode with Swank::Error.

It provides the <form> tags around the page content.

/site.swank_wrap points to the global layout page.

Its placement also makes it hard to edit inside the wiki (confusing but not impossible) because of a sort of chicken-and-egg effect when it tries to display itself within itself.  More work is needed to resolve this.  The global layout page, which is normally wrapped around this page, displays itself inside itself much better.